﻿<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	x:Class="LFractal.LEntityRenderer"
	x:Name="LEntityRendererWindow"
	Title="L-Entity-Renderer"
	Width="900" Height="480"
	WindowStyle="None"
  	ResizeMode="CanResizeWithGrip"
  	ShowInTaskbar="False"
  	AllowsTransparency="True"
  	WindowState="Maximized" MouseLeftButtonDown="LEntityRendererWindow_MouseLeftButtonDown" 
	>
	<Border BorderBrush="Gray"           
            BorderThickness="2,2,2,2"
            CornerRadius="10"
            Background="#FFE8ECF4">
      <!-- Create space between shadow and the next border -->
      <Border BorderBrush="Transparent"
              BorderThickness="5"
              CornerRadius="10" Margin="0,0,0,0">
        <!-- The inner border -->
        <Border BorderBrush="Black"
                BorderThickness="1.5"
                CornerRadius="10" Background="White" >
			<Grid x:Name="LayoutRoot">
				<Grid.RowDefinitions>
					<RowDefinition Height="*" />
					<RowDefinition Height="50" MaxHeight="50" />
				</Grid.RowDefinitions>
				<Canvas Grid.Row="0" Name="drawingCanvas">
					<Canvas.LayoutTransform>
				        <ScaleTransform 
				            CenterX="0" CenterY="0"
				            ScaleX="{Binding ElementName=uiScaleSlider,Path=Value}"
				            ScaleY="{Binding ElementName=uiScaleSlider,Path=Value}"
				        />
				    </Canvas.LayoutTransform>
				</Canvas>
				<ToolBar Grid.Row="1"  HorizontalAlignment="Center">
					<Button Name="btnBack" Width="25" Height="40" VerticalAlignment="Center" Click="btnBack_Click" >
						<Image  Source="Images/CloseButton.jpg"  />
					</Button>
					<Menu>
						<MenuItem Header="File" Height="20" VerticalAlignment="Center">
							<MenuItem Header="Save" Name="menuSave"  Click="menuSave_Click" />
							<MenuItem Header="Export as image" Name="menuExportImage"  Click="menuExportImage_Click"/>
							<MenuItem Header="Share with others" Name="menuShare" Click="menuShare_Click" />
						</MenuItem>
					</Menu>
					<Separator />
					<Label VerticalAlignment="Center">Zoom:</Label>
					<Slider Name="uiScaleSlider" Width="200" Value="1.0" Minimum="-3.0" Maximum="3.0" VerticalAlignment="Center" ></Slider>
					<ToggleButton  Name="btnDrag" ToolTip="Pan canvas" VerticalAlignment="Center">
							<Image  Source="Images/DragButton.jpg"  />
					</ToggleButton> 
					<Separator />
					<GroupBox Header="Level">
						<StackPanel Orientation="Horizontal">
							<Button Content="&lt;" Name="btnPrevLevel" Click="btnPrevLevel_Click" >
								<Button.Background>
									<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
										<GradientStop Color="#FFF3F3F3" Offset="0"/>
										<GradientStop Color="#FFEBEBEB" Offset="0.5"/>
										<GradientStop Color="#FFDDDDDD" Offset="0.5"/>
										<GradientStop Color="#FFB3D8DB" Offset="1"/>
									</LinearGradientBrush>
								</Button.Background>
							</Button>
							<TextBox Name="txtLevel" Width="25" BorderBrush="LightBlue"  Text="0" KeyUp="txtLevel_KeyUp" />
							<Button Content="&gt;" Name="btnNextLevel" Click="btnNextLevel_Click">
								<Button.Background>
									<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
										<GradientStop Color="#FFF3F3F3" Offset="0"/>
										<GradientStop Color="#FFEBEBEB" Offset="0.5"/>
										<GradientStop Color="#FFDDDDDD" Offset="0.5"/>
										<GradientStop Color="#FFB3D8DB" Offset="1"/>
									</LinearGradientBrush>
								</Button.Background>
							</Button>
						</StackPanel>
					</GroupBox>
					<GroupBox Header="Origin" FontSize="10" BorderBrush="Black" Margin="2">
						<TextBox Name="txtOrigin" Text="000,000" Width="50" KeyUp="txtOrigin_KeyUp" />
					</GroupBox>
					<GroupBox Header="Arm Length" FontSize="10" BorderBrush="Black"  Margin="2">
						<TextBox Name="txtSegLenth" Text="035" Width="50" HorizontalAlignment="Left" KeyUp="txtSegLenth_KeyUp" />
					</GroupBox>
					<GroupBox Header="Alpha" FontSize="10" BorderBrush="Black"  Margin="2">
						<TextBox Name="txtAlpha" Text="090" Width="25" HorizontalAlignment="Left" KeyUp="txtAlpha_KeyUp" />
					</GroupBox>
					<GroupBox Header="Delta" FontSize="10" BorderBrush="Black"  Margin="2">
						<TextBox Name="txtDelta" Text="030" Width="25" HorizontalAlignment="Left" KeyUp="txtDelta_KeyUp" />
					</GroupBox>
					<Button  Name="btnRefresh" ToolTip="Refresh" VerticalAlignment="Center" Click="btnRefresh_Click">
							<Image  Source="Images/RefreshButton.jpg"  />
					</Button> 
					<ToggleButton  Name="btnShowGrid" ToolTip="Grid lines" VerticalAlignment="Center" BorderThickness="2">
							<Image  Source="Images/GridButton.jpg" Height="40" />
					</ToggleButton> 
				</ToolBar>
			</Grid>
		</Border>
	</Border>
	</Border>
</Window>